package com.cloud.qualitycontrol.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "t_folder")
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
public class FileFolder {

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    private String id;
    private String qualityId;                                      //quality node id
    private String name;
    @ElementCollection(targetClass=String.class)
    private List<String> fileNameList;

    public FileFolder setId(String id) {
        this.id = id;
        return this;
    }

    public FileFolder setQualityId(String qualityId) {
        this.qualityId = qualityId;
        return this;
    }

    public FileFolder setName(String name) {
        this.name = name;
        return this;
    }

    public FileFolder setFileNameList(List<String> fileNameList) {
        this.fileNameList = fileNameList;
        return this;
    }
}
